在Wt中要写Web Service,并且返回XML的话,可继承WResource,重载其handleRequest方法,并且使用WServer::addResource将这個WResource子类绑定到一個固定的URL上。
http://redmine.webtoolkit.eu/boards/2/topics/2438
亮点:
Actually, for the non-HTML output, you need to implement resources. If you want these resources to map to 'global' URLs (which I guess is the case for web services), you should deploy them as static resources (WServer::addResource()); if you want to tie them to a session (protected by the session ID), you should add them directly to a WAnchor.
A WApplication only serves a purpose for a normal (HTML/JavaScript/CSS) interactive session.
As an example of an RSS feed which is global, consider the blog example / homepage example, where the RSS feed for the blog is a static resource.
HxLauncher: Launch Android applications by voice commands